// Licensed to LinDB under one or more contributor
// license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright
// ownership. LinDB licenses this file to you under
// the Apache License, Version 2.0 (the "License"); you may
// not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied.  See the License for the
// specific language governing permissions and limitations
// under the License.

// Package docs GENERATED BY SWAG; DO NOT EDIT
// This file was generated by swaggo/swag
package docs

import "github.com/swaggo/swag"

const docTemplate = `{
    "schemes": {{ marshal .Schemes }},
    "swagger": "2.0",
    "info": {
        "description": "{{escape .Description}}",
        "title": "{{.Title}}",
        "contact": {
            "name": "API Support",
            "url": "https://lindb.io"
        },
        "license": {
            "name": "Apache 2.0",
            "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
        },
        "version": "{{.Version}}"
    },
    "host": "{{.Host}}",
    "basePath": "{{.BasePath}}",
    "paths": {
        "/config": {
            "get": {
                "description": "return current node's configuration.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "State"
                ],
                "summary": "current node's configuration",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object"
                        }
                    }
                }
            }
        },
        "/exec": {
            "get": {
                "description": "Execute lin query language with rate limit, then return different response based on execution statement.\n1. metric data/metadata query statement;\n2. cluster metadata/state query statement;\n3. database/storage management statement;",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "LinQL"
                ],
                "summary": "execute lin query language",
                "parameters": [
                    {
                        "description": "param data",
                        "name": "param",
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/models.ExecuteParam"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.Metadata"
                        }
                    },
                    "404": {
                        "description": "not found",
                        "schema": {
                            "type": "string"
                        }
                    },
                    "500": {
                        "description": "internal error",
                        "schema": {
                            "type": "string"
                        }
                    }
                }
            },
            "put": {
                "description": "Execute lin query language with rate limit, then return different response based on execution statement.\n1. metric data/metadata query statement;\n2. cluster metadata/state query statement;\n3. database/storage management statement;",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "LinQL"
                ],
                "summary": "execute lin query language",
                "parameters": [
                    {
                        "description": "param data",
                        "name": "param",
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/models.ExecuteParam"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.Metadata"
                        }
                    },
                    "404": {
                        "description": "not found",
                        "schema": {
                            "type": "string"
                        }
                    },
                    "500": {
                        "description": "internal error",
                        "schema": {
                            "type": "string"
                        }
                    }
                }
            },
            "post": {
                "description": "Execute lin query language with rate limit, then return different response based on execution statement.\n1. metric data/metadata query statement;\n2. cluster metadata/state query statement;\n3. database/storage management statement;",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "LinQL"
                ],
                "summary": "execute lin query language",
                "parameters": [
                    {
                        "description": "param data",
                        "name": "param",
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/models.ExecuteParam"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/models.Metadata"
                        }
                    },
                    "404": {
                        "description": "not found",
                        "schema": {
                            "type": "string"
                        }
                    },
                    "500": {
                        "description": "internal error",
                        "schema": {
                            "type": "string"
                        }
                    }
                }
            }
        },
        "/log/list": {
            "get": {
                "description": "return all log files in log dir.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "State"
                ],
                "summary": "list log files",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object"
                        }
                    },
                    "404": {
                        "description": "not found",
                        "schema": {
                            "type": "string"
                        }
                    },
                    "500": {
                        "description": "internal error",
                        "schema": {
                            "type": "string"
                        }
                    }
                }
            }
        },
        "/log/view": {
            "get": {
                "description": "return last N lines in log file.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "text/plain"
                ],
                "tags": [
                    "State"
                ],
                "summary": "tail log file",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "string"
                        }
                    },
                    "404": {
                        "description": "not found",
                        "schema": {
                            "type": "string"
                        }
                    },
                    "500": {
                        "description": "internal error",
                        "schema": {
                            "type": "string"
                        }
                    }
                }
            }
        },
        "/proxy": {
            "get": {
                "description": "Forward request to target server by given target ip and path.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "State"
                ],
                "summary": "reverse proxy",
                "parameters": [
                    {
                        "description": "param data",
                        "name": "param",
                        "in": "body",
                        "schema": {
                            "$ref": "#/definitions/models.ProxyParam"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object"
                        }
                    },
                    "404": {
                        "description": "not found",
                        "schema": {
                            "type": "string"
                        }
                    },
                    "500": {
                        "description": "internal error",
                        "schema": {
                            "type": "string"
                        }
                    }
                }
            }
        },
        "/write": {
            "put": {
                "description": "receive metric data, then parse the data based on content type(flat buffer/proto buffer/influx).\nwrite data via database channel, support content-type as below:\n1. application/flatbuffer\n2. application/protobuf\n3. application/influx",
                "consumes": [
                    "application/flatbuffer",
                    "application/protobuf",
                    "application/influx"
                ],
                "produces": [
                    "text/plain"
                ],
                "tags": [
                    "Write"
                ],
                "summary": "write metric data",
                "parameters": [
                    {
                        "type": "string",
                        "description": "database name",
                        "name": "db",
                        "in": "query",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "namespace, default value: default-ns",
                        "name": "ns",
                        "in": "query"
                    },
                    {
                        "description": "metric data",
                        "name": "string",
                        "in": "body",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content",
                        "schema": {
                            "type": "string"
                        }
                    },
                    "500": {
                        "description": "internal error",
                        "schema": {
                            "type": "string"
                        }
                    }
                }
            },
            "post": {
                "description": "receive metric data, then parse the data based on content type(flat buffer/proto buffer/influx).\nwrite data via database channel, support content-type as below:\n1. application/flatbuffer\n2. application/protobuf\n3. application/influx",
                "consumes": [
                    "application/flatbuffer",
                    "application/protobuf",
                    "application/influx"
                ],
                "produces": [
                    "text/plain"
                ],
                "tags": [
                    "Write"
                ],
                "summary": "write metric data",
                "parameters": [
                    {
                        "type": "string",
                        "description": "database name",
                        "name": "db",
                        "in": "query",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "namespace, default value: default-ns",
                        "name": "ns",
                        "in": "query"
                    },
                    {
                        "description": "metric data",
                        "name": "string",
                        "in": "body",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content",
                        "schema": {
                            "type": "string"
                        }
                    },
                    "500": {
                        "description": "internal error",
                        "schema": {
                            "type": "string"
                        }
                    }
                }
            }
        }
    },
    "definitions": {
        "models.ExecuteParam": {
            "type": "object",
            "required": [
                "sql"
            ],
            "properties": {
                "db": {
                    "type": "string"
                },
                "sql": {
                    "type": "string"
                }
            }
        },
        "models.LeafNodeStats": {
            "type": "object",
            "properties": {
                "end": {
                    "type": "integer"
                },
                "netPayload": {
                    "type": "integer"
                },
                "stages": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/models.StageStats"
                    }
                },
                "start": {
                    "type": "integer"
                },
                "totalCost": {
                    "type": "integer"
                }
            }
        },
        "models.Metadata": {
            "type": "object",
            "properties": {
                "type": {
                    "type": "string"
                },
                "values": {}
            }
        },
        "models.OperatorStats": {
            "type": "object",
            "properties": {
                "cost": {
                    "type": "integer"
                },
                "end": {
                    "type": "integer"
                },
                "errMsg": {
                    "type": "string"
                },
                "identifier": {
                    "type": "string"
                },
                "start": {
                    "type": "integer"
                },
                "stats": {}
            }
        },
        "models.ProxyParam": {
            "type": "object",
            "required": [
                "path",
                "target"
            ],
            "properties": {
                "path": {
                    "type": "string"
                },
                "target": {
                    "type": "string"
                }
            }
        },
        "models.QueryStats": {
            "type": "object",
            "properties": {
                "brokerNodes": {
                    "type": "object",
                    "additionalProperties": {
                        "$ref": "#/definitions/models.QueryStats"
                    }
                },
                "end": {
                    "type": "integer"
                },
                "expressCost": {
                    "type": "integer"
                },
                "expressEnd": {
                    "type": "integer"
                },
                "expressStart": {
                    "type": "integer"
                },
                "leafNodes": {
                    "type": "object",
                    "additionalProperties": {
                        "$ref": "#/definitions/models.LeafNodeStats"
                    }
                },
                "netPayload": {
                    "type": "integer"
                },
                "planCost": {
                    "type": "integer"
                },
                "planEnd": {
                    "type": "integer"
                },
                "planStart": {
                    "type": "integer"
                },
                "root": {
                    "type": "string"
                },
                "start": {
                    "type": "integer"
                },
                "totalCost": {
                    "description": "total query cost",
                    "type": "integer"
                },
                "waitCost": {
                    "description": "wait intermediate or leaf response duration",
                    "type": "integer"
                },
                "waitEnd": {
                    "type": "integer"
                },
                "waitStart": {
                    "type": "integer"
                }
            }
        },
        "models.ResultSet": {
            "type": "object",
            "properties": {
                "endTime": {
                    "type": "integer"
                },
                "fields": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "groupBy": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "interval": {
                    "type": "integer"
                },
                "metricName": {
                    "type": "string"
                },
                "series": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/models.Series"
                    }
                },
                "startTime": {
                    "type": "integer"
                },
                "stats": {
                    "$ref": "#/definitions/models.QueryStats"
                }
            }
        },
        "models.Series": {
            "type": "object",
            "properties": {
                "fields": {
                    "type": "object",
                    "additionalProperties": {
                        "type": "object",
                        "additionalProperties": {
                            "type": "number"
                        }
                    }
                },
                "tags": {
                    "type": "object",
                    "additionalProperties": {
                        "type": "string"
                    }
                }
            }
        },
        "models.StageStats": {
            "type": "object",
            "properties": {
                "async": {
                    "type": "boolean"
                },
                "children": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/models.StageStats"
                    }
                },
                "cost": {
                    "type": "integer"
                },
                "end": {
                    "type": "integer"
                },
                "errMsg": {
                    "type": "string"
                },
                "identifier": {
                    "type": "string"
                },
                "operators": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/models.OperatorStats"
                    }
                },
                "start": {
                    "type": "integer"
                },
                "state": {
                    "type": "string"
                }
            }
        }
    }
}`

// SwaggerInfo holds exported Swagger Info so clients can modify it
var SwaggerInfo = &swag.Spec{
	Version:          "1.0",
	Host:             "http://localhost:9000",
	BasePath:         "/api/v1",
	Schemes:          []string{"http"},
	Title:            "LinDB Open API",
	Description:      "LinDB Open API",
	InfoInstanceName: "swagger",
	SwaggerTemplate:  docTemplate,
}

func init() {
	swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
}
